package com.atguigu03.date.brfore8;

import org.junit.Test;

import java.util.Date;

public class DateTimeTest {
    @Test
    public void test1(){
        Date date1 = new Date();//创建一个基于当前系统时间的Date的实例
         System.out.println(date1.toString());
        long milliTimes = date1.getTime();
        System.out.println("对应的毫秒数为:"+ milliTimes); //1670212256045

            Date date2 = new Date(1370202256045L);//创建一个基于指定时间戳的Date的实例
         System.out.println(date2.toString());

    }

    @Test
    public  void Test2(){
        java.sql.Date date1=new java.sql.Date (1370202256045L);
        System.out.println(date1.toString());
    }

}
